import type { FC } from 'react';

import styles from './index.less';

export interface Props {
  dataSource: string[];
  title: string;
}

const TextView: FC<Props> = (props) => {
  const { dataSource, title } = props;

  return (
    <div className={styles.textBodyStyle}>
      <div className={styles.head}>{title}</div>
      {dataSource &&
        dataSource.map((item) => {
          return (
            <div key={Math.random()} className={styles.title}>
              <div className={styles.dot} />
              {item}
            </div>
          );
        })}
    </div>
  );
};

export default TextView;
